<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>盒模型</title>
</head>
<style>
    #div1{
        width: 100px;
        padding: 10px;
        border: 1px solid #000000;
        margin: 10px;
        box-sizing: border-box; // 怪异盒模型，当前offsetWidth为100px，去掉则122px
    }
</style>
<body>
<div id="div1">
    this is div1
</div>
<script>
    console.log(document.getElementById('div1').offsetWidth)
</script>
</body>
</html>
